package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._12状态模式._3工作状态;

//上午工作状态
class ForenoonState extends State {
    public void writeProgram (Work w) {
        if (w.getHour() < 12)  {
            System.out.println("当前时间："+ w.getHour() +"点 上午工作，精神百倍");
        }
        else {
            w.setState(new NoonState());
            w.writeProgram();
        }
    }
}